Skip to content

ci: supply-chain hardening (PR 1/2) — Node 24, harden-runner, Dependabot cooldown, CodeQL - #42

Merged
Nelson Spence (Fieldnote-Echo) merged 6 commits into
mainfrom
chore/supply-chain-ci-hardening
May 25, 2026
Merged

ci: supply-chain hardening (PR 1/2) — Node 24, harden-runner, Dependabot cooldown, CodeQL#42
Nelson Spence (Fieldnote-Echo) merged 6 commits into
mainfrom
chore/supply-chain-ci-hardening

Conversation

@Fieldnote-Echo

Copy link
Copy Markdown
Member

Pre-release supply-chain hardening, part 1 of 2 (always-on CI; PR-2 will add SBOM + build-provenance attestation to the held release workflows). Built in parallel by Opus supply-chain subagents on disjoint files, then centrally verified.

Changes

  1. Node-20 → Node-24 (fixes the GitHub deprecation forcing Node 24 by Jun 2026): actions/checkout v4→v6, actions/setup-python v5→v6. ci.yml/python.yml use major tags (read-only CI); audit.yml/changelog.yml re-pinned to the v6.0.2 SHA (scheduled / write-scoped).
  2. harden-runner (step-security/harden-runner@v2.19.4, SHA-pinned, egress-policy: audit) as the first step of every job across ci/python/audit/changelog/codeql — an EDR-style egress/process/file baseline. Audit (not block) avoids breaking egress and is supported on Linux/macOS/Windows.
  3. Dependabot (.github/dependabot.yml) — github-actions (primary) + cargo (workspace + the excluded fuzz crate) + pip (ordvec-python). Every ecosystem has cooldown.default-days: 7 → no same-day bumps, so a freshly published malicious release (the "mini shai-hulud" worm class) has a week to be flagged before we PR it. Grouped to cut noise.
  4. CodeQL (.github/workflows/codeql.yml) — scans rust + python + actions (all GA; build-mode: none, no compiler run). push/PR to main + weekly (off the audit.yml slot). Least-privilege (security-events: write only on the analyze job); all actions SHA-pinned.

Pinning policy (consistent)

SHA-pin every action in write-scoped or scheduled workflows (audit, changelog, codeql); major tags in read-only push/PR CI (ci, python). harden-runner SHA-pinned everywhere. Dependabot now keeps all of these current — delayed 7 days.

Verified locally

  • YAML parses for all 6 files.
  • harden-runner on all 13 job-instances; zero stale checkout@v4 / setup-python@v5 refs.
  • changelog.yml diff is only harden-runner + the checkout pin — the strict-SemVer gate (from ci: gate changelog workflow on strict SemVer tags #41) is byte-for-byte intact.
  • harden-runner v2.19.4 confirmed to support the macOS/Windows test legs; CodeQL build-mode: none confirmed valid for rust/python/actions.

Excluded by design: changelog.yml Node bump is included here (since #41 merged). The release workflows (release-crate.yml/release-python.yml) were already on checkout v6; their SBOM + attestation hardening is PR-2.

Merges under the strict protection (CI + 1 non-self code-owner approval).

Node-20 deprecation fix (GitHub forces Node 24 by 2026-06): actions/checkout v4->v6 (ci/python as tags; audit/changelog re-pinned to the v6.0.2 SHA), actions/setup-python v5->v6 (python). Adds step-security/harden-runner@v2.19.4 (SHA-pinned, egress-policy: audit) as the first step of every job — an EDR-style egress/process/file baseline. Audit (not block) avoids breaking egress and is supported on Linux/macOS/Windows runners. The changelog SemVer gate is unchanged.
github-actions (primary), cargo (workspace + the excluded fuzz crate), and pip (ordvec-python). Every ecosystem carries cooldown.default-days: 7 so nothing is auto-bumped same-day — a freshly published malicious release (the 'mini shai-hulud' npm-worm class of supply-chain attack) gets a week to be flagged/yanked before we'd open a PR. Grouped to cut noise.
Scans rust + python + actions (all GA; build-mode: none — no compiler/MSRV run). push/PR to main + weekly schedule (off the audit.yml slot). Least-privilege: security-events: write only on the analyze job; all actions SHA-pinned (scheduled + write-scoped); harden-runner first.
@qodo-code-review

Copy link
Copy Markdown

Review Summary by Qodo

Supply-chain hardening: Node 24, harden-runner, Dependabot, CodeQL

✨ Enhancement 🧪 Tests

Grey Divider

Walkthroughs

Description
• Upgrade Node.js runtime to v24 (checkout v4→v6, setup-python v5→v6)
• Add harden-runner EDR baseline to all 13 jobs across workflows
• Implement Dependabot with 7-day cooldown for supply-chain attack mitigation
• Add CodeQL scanning for Rust, Python, and GitHub Actions code
Diagram
flowchart LR
  A["GitHub Actions<br/>Node 20 Deprecation"] -->|"Upgrade to v24"| B["Update checkout v4→v6<br/>setup-python v5→v6"]
  C["Supply-Chain<br/>Attack Risk"] -->|"EDR Baseline"| D["harden-runner v2.19.4<br/>audit egress policy"]
  E["Malicious Release<br/>Detection"] -->|"7-day Cooldown"| F["Dependabot<br/>github-actions/cargo/pip"]
  G["Code Security<br/>Scanning"] -->|"Multi-language"| H["CodeQL<br/>Rust/Python/Actions"]
  B --> I["All Workflows<br/>Hardened"]
  D --> I
  F --> I
  H --> I

Loading

File Changes

1. .github/dependabot.yml ⚙️ Configuration changes +64/-0

Dependabot configuration with supply-chain attack mitigation

• New file: configures Dependabot for github-actions, cargo (workspace + fuzz), and pip ecosystems
• Implements 7-day cooldown on all ecosystems to delay malicious release auto-PR by one week
• Groups minor/patch updates to reduce PR noise; major versions reviewed separately
• Sets open-pull-requests-limit to 5 (2 for fuzz) to manage queue

.github/dependabot.yml


2. .github/workflows/audit.yml ✨ Enhancement +4/-1

Add harden-runner and upgrade checkout to v6

• Adds harden-runner@v2.19.4 (SHA-pinned) as first step with audit egress policy
• Upgrades actions/checkout from v4.3.1 SHA to v6.0.2 SHA
• Maintains existing cargo-deny advisories check functionality

.github/workflows/audit.yml


3. .github/workflows/changelog.yml ✨ Enhancement +5/-2

Add harden-runner and upgrade checkout to v6

• Adds harden-runner@v2.19.4 (SHA-pinned) as first step with audit egress policy
• Upgrades actions/checkout from v4.3.1 SHA to v6.0.2 SHA
• Updates inline comment to reflect v6.0.2 version; SemVer gate logic unchanged
• Preserves strict release-notes gate and git-cliff-action integration

.github/workflows/changelog.yml


View more (3)
4. .github/workflows/ci.yml ✨ Enhancement +34/-8

Add harden-runner and upgrade checkout to v6 across all jobs

• Adds harden-runner@v2.19.4 (SHA-pinned, audit egress) as first step in all 9 jobs
• Upgrades actions/checkout from v4 tag to v6 tag across lint, test, msrv, deps, deny, avx512, wasm,
 bench jobs
• Adds explanatory comment on harden-runner purpose (egress baseline, audit-only)
• Maintains all existing test logic, toolchain pins, and cache configurations

.github/workflows/ci.yml


5. .github/workflows/codeql.yml ✨ Enhancement +72/-0

CodeQL static analysis for Rust, Python, and Actions

• New file: CodeQL scanning workflow for Rust, Python, and GitHub Actions languages
• Runs on push/PR to main and weekly schedule (Wednesday 07:42 UTC, offset from audit.yml)
• Uses build-mode: none for fast, compiler-independent database creation (GA for all three
 languages)
• Implements least-privilege permissions (security-events: write only on analyze job)
• All third-party actions SHA-pinned; harden-runner first step with audit egress policy

.github/workflows/codeql.yml


6. .github/workflows/python.yml ✨ Enhancement +9/-3

Add harden-runner and upgrade actions to v6

• Adds harden-runner@v2.19.4 (SHA-pinned, audit egress) as first step in lint and build jobs
• Upgrades actions/checkout from v4 tag to v6 tag in both jobs
• Upgrades actions/setup-python from v5 tag to v6 tag in build job
• Preserves all Python version matrix, abi3 floor/ceiling, and cross-platform test coverage

.github/workflows/python.yml


Grey Divider

Qodo Logo

@qodo-code-review

qodo-code-review Bot commented May 25, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Remediation recommended

1. CodeQL fork PR failure ✓ Resolved 🐞 Bug ☼ Reliability
Description
The new CodeQL workflow runs on pull_request but requires security-events: write to upload
SARIF; on forked PRs the token is read-only, so the analysis/upload step can fail and potentially
block external PRs if this check is required.
Code

.github/workflows/codeql.yml[R22-48]

Evidence
The workflow is triggered for pull_request events and the job explicitly requests
security-events: write, which is the permission needed for SARIF upload and is the permission that
is typically unavailable to fork PR runs.

.github/workflows/codeql.yml[22-30]
.github/workflows/codeql.yml[41-49]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`.github/workflows/codeql.yml` runs on `pull_request` and the `analyze` job requests `security-events: write`. Forked PR runs typically cannot obtain that permission, which can make CodeQL fail when it tries to upload SARIF.

## Issue Context
You likely want CodeQL on PRs, but you need to avoid the upload path (or the whole job) on fork PRs.

## Fix Focus Areas
- .github/workflows/codeql.yml[22-72]

## Suggested fix options
1) **Skip CodeQL entirely for fork PRs** (keeps push + schedule coverage):
  - Add an `if:` on the job such as:
    - `if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository`
2) **Split into two jobs**:
  - A PR job that runs only when PR is from same repo (can upload), and a push/schedule job that always uploads.
3) If you truly need fork PR scanning, consider a `pull_request_target`-based design, but only with strict safeguards (never executing untrusted code with write scopes).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new .github/dependabot.yml configuration file to automate dependency updates for GitHub Actions, Cargo, and Pip. The review feedback correctly identifies that the cooldown property included in all update blocks is not supported by the official Dependabot schema and will cause the configuration to be invalid.

Comment thread .github/dependabot.yml
Comment thread .github/dependabot.yml
Comment thread .github/dependabot.yml
Comment thread .github/dependabot.yml

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces supply-chain hardening for the repository’s GitHub Actions CI by upgrading Node-24-compatible action versions, adding runner egress auditing, configuring Dependabot across ecosystems with a cooldown, and enabling CodeQL scanning.

Changes:

  • Upgraded CI workflows to actions/checkout@v6 (tagged for read-only CI; SHA-pinned where scheduled/write-scoped) and actions/setup-python@v6 in the Python CI workflow.
  • Added step-security/harden-runner (SHA-pinned) as the first step of each job with egress-policy: audit.
  • Added new .github/dependabot.yml (multi-ecosystem, grouped updates, 7-day cooldown) and a new SHA-pinned CodeQL workflow scanning Rust, Python, and GitHub Actions.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/workflows/ci.yml Adds harden-runner and updates checkout to v6 across all CI jobs.
.github/workflows/python.yml Adds harden-runner; updates checkout to v6 and setup-python to v6 for the bindings CI.
.github/workflows/audit.yml Adds harden-runner and updates SHA-pinned checkout to v6.0.2 for scheduled advisories scans.
.github/workflows/changelog.yml Adds harden-runner and updates SHA-pinned checkout to v6.0.2 in the write-scoped release-notes workflow.
.github/workflows/codeql.yml Adds a new SHA-pinned CodeQL workflow with least-privilege permissions and no-build analysis.
.github/dependabot.yml Adds Dependabot configuration for github-actions, cargo (root + fuzz), and pip (ordvec-python) with grouping and cooldown.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6654601316

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Comment thread .github/workflows/codeql.yml Outdated
Codex P1 (#42): github/codeql-action@v3 still declares runs.using: node20 for init/analyze, so it would break at the Node-20 retirement. v4 runs on node24 (verified: init/action.yml -> 'using: node24'). Pin init + analyze to the v4 SHA 7211b7c. Same inputs (languages / build-mode: none / category); the analyze legs already pass on v3, and v4 is the same engine on a newer runtime.
…review)

qodo (Reliability): on a pull_request from a fork, GitHub provides a read-only GITHUB_TOKEN, so github/codeql-action/analyze's SARIF upload (security-events: write) fails — a spurious failure on external PRs. Gate the analyze job with 'github.event_name != pull_request || head.repo.full_name == github.repository' so it runs on push-to-main + the weekly schedule (full coverage) and same-repo PRs (PR-time scanning), and skips fork PRs. CodeQL is also not in the required-status-check set, so fork PRs are never blocked regardless.
@Fieldnote-Echo

Copy link
Copy Markdown
Member Author

/agentic_review

@qodo-code-review

qodo-code-review Bot commented May 25, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit 4a73aa3

@Fieldnote-Echo
Nelson Spence (Fieldnote-Echo) merged commit 764049a into main May 25, 2026
21 checks passed
@Fieldnote-Echo
Nelson Spence (Fieldnote-Echo) deleted the chore/supply-chain-ci-hardening branch May 25, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants